//
//  Main_TableView_Cell.m
//  Time
//
//  Created by dllo on 16/7/21.
//  Copyright © 2016年 司昌宝. All rights reserved.
//

#import "Main_TableView_Cell.h"

@interface Main_TableView_Cell ()
/**
 *  标题名label
 */
@property (nonatomic,retain) UILabel *nameLabel;

@end


@implementation Main_TableView_Cell

-(void)dealloc{
    [_nameLabel release];
    [_titleName release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.nameLabel.font = [UIFont systemFontOfSize:20.0];
    self.nameLabel.textColor = [UIColor whiteColor];
    [self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
        make.top.equalTo(self.contentView.mas_top).offset(0);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(0);
    }];
    
    
}

-(void)setTitleName:(NSString *)titleName{
    if (_titleName != titleName){
        [_titleName release];
        _titleName = [titleName retain];
    }
    
    self.nameLabel.text = titleName;
}




@end
